<?php
class Sfs_View_Helper_YearOptions
{
    /**
     * 回傳學年學期陣列
     *
     *@param $selected 預設選取
     * @param 額外設定 $arr
     * $arr['date'] 基準日期
     * $arr['order'] 排序方式
     *
     * @return array
     */
    function YearOptions($selected=''){
        $semester = new Semester_Model_SemesterDuration();
        $res = $semester->getAllYear();
        $str = '';
        foreach($res as $val=>$text) {
            $str .= "<option value='".$val."' label='$val' ";
            if ($val == $selected) $str.=" selected='selected' ";
            $str.=">".$text."</option>";
        }
        return $str;
    }

}